package androidx.gdata.documents.xml;

import java.io.PrintWriter;

import androidx.gdata.XMLSerializer;
import androidx.gdata.documents.Entry;
import androidx.gdata.xml.CategorySerializer;

public class EntrySerializer implements XMLSerializer<Entry> {
  
  private CategorySerializer categorySerializer;
  
  public EntrySerializer() {
    categorySerializer = new CategorySerializer();
    //categorySerializer.setExtraIndent("  ");
  }
  
  public void serialize(PrintWriter out, Entry entry) {
    out.println("<entry xmlns='http://www.w3.org/2005/Atom'>");
    categorySerializer.serialize(out, entry.getCategory());
    out.println("  <title>" + entry.getTitle() + "</title>");
    out.println("</entry>");
  }

}
